<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <title>分类 | Saw96x's Blog</title>
</head>
<body>
<!--<img class="ui fluid image m-background">-->
<!--导航-->
<nav th:replace="_fragments :: menu(2)">
    <div class="ui container">
        <div class="ui    secondary stackable menu">
            <h2 class="ui violet header item">Blog</h2>
            <a href="#" class="m-item violet item m-mobile-hide"><i class="home icon"></i> 首页</a>
            <a href="#" class="active m-item violet item m-mobile-hide"><i class="idea icon"></i> 分类</a>
            <a href="#" class="m-item violet item m-mobile-hide"><i class="tags icon"></i> 标签</a>
            <a href="#" class="m-item violet item m-mobile-hide"><i class="clone icon"></i> 归档</a>
            <div class="right item">
                <div class="ui    m-item icon transparent input m-mobile-hide">
                    <input type="text" placeholder="搜索文章">
                    <i class="search  link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle    icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--    中间内容-->
<div class="m-padded-tb-large m-opacity-mini m-container-small">
    <div class="ui container ">
<!--        header-->
        <div class="ui top attached segment m-shadow-small">
            <div class="ui middle aligned two column grid ">
                <div class="column">
                    <h3 class="ui violet header">分类</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui violet header m-inline-block m-text-thin" th:text="${#arrays.length(types)}"> 14 </h2> 个分类
                </div>
            </div>
        </div>
<!--        分类-->
        <div class="ui attached segment m-padded-tb-big m-shadow-small">
            <div class="ui labeled button m-margin-tb-tiny" th:each="type : ${types}">
                <a href="#" th:href="@{/types/{id}(id=${type.id})}" class="ui basic button" th:classappend="${type.id==activeTypeId} ? 'violet'" th:text="${type.name}">思考与感悟</a>
                <div class="ui basic left pointing label" th:classappend="${type.id==activeTypeId} ? 'violet'" th:text="${#arrays.length(type.blogs)}">12</div>
            </div>
        </div>
<!--        博客列表-->
        <div class="ui top attached violet segment m-shadow-small">
            <div class="ui padded vertical segment m-padded-tb-large"  th:each="blog : ${page.content}">
                <div class="ui mobile reversed stackable grid">
                    <div class="ui eleven wide column">
                        <h3 class="ui header ">
                            <a href="#" class="m-black" target="_blank" th:href="@{/blog/{id}(id=${blog.id})}" th:text="${blog.title}">
                                你真的理解什么是财富自由吗？
                            </a>
                        </h3>
                        <p th:text="|${blog.description}。。。。。。|">
                            这些话就是测试用的，要看样式，别看这个文字，我相信你不会无聊的看这个吧。。。asdfasdfasdfasdfasdfasfdasdfasd
                        </p>
                        <div class="ui grid">
                            <div class="eleven wide column">
                                <div class="ui horizontal link list">
                                    <div class="item">
                                        <img src="https://unsplash.it/110/110?image=1004" th:src="@{${blog.user.avatar}}" alt=""
                                             class="ui avatar image">
                                        <div class="content">
                                            <div class="header" th:text="${blog.user.nickname}"><a href="#">南望96X</a></div>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2020-10-1</span>
                                    </div>
                                    <div class="item">
                                        <i class="eye icon"></i><span th:text="${blog.views}">2342</span>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a href="#" target="_blank" class="ui violet basic label" th:text="${blog.type.name}">认知升级</a>
                            </div>
                        </div>
                    </div>
                    <div class="ui five wide column">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img src="https://unsplash.it/180/110?image=1005" th:src="@{${blog.firstPicture}}" alt="" class="ui fluid rounded image">
                        </a>
                    </div>
                </div>
            </div>
        </div>
<!--        分页条-->
        <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a href="#" th:href="@{/types/{id}?page={page}(id=${activeTypeId},page=${page.number}-1)}" th:unless="${page.first}" class="ui violet basic button">上一页</a>
                </div>
                <div class="right aligned column">
                    <a href="#" th:href="@{/types/{id}?page={page}(id=${activeTypeId},page=${page.number}+1)}" th:unless="${page.last}" class="ui violet basic button">下一页</a>
                </div>
            </div>
        </div>
    </div>
</div>
<br>
<br>
<br>
<br>
<br>
<!--    底部-->
<footer th:replace="_fragments :: footer">
</footer>

<script crossorigin="anonymous" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
        src="https://lib.baomitu.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
</script>
<script type="text/javascript" color="0,0,255" opacity='1' zIndex="-1" count="150"
        src="//cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js"></script>
<th:block th:replace="_fragments :: script"></th:block>
</body>
</html>
